# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=lazagne
pkgver=889.858ff6f
pkgrel=1
groups=('blackarch' 'blackarch-forensic' 'blackarch-social')
arch=('any')
pkgdesc='An open source application used to retrieve lots of passwords stored on a local computer.'
url='https://github.com/AlessandroZ/LaZagne'
license=('LGPL3')
depends=('python' 'python-argparse' 'python-psutil' 'python-pycryptodome'
         'python-pyasn1' 'python-pydes' 'python-pbkdf2' 'python-libkeepass')
makedepends=('git')
source=("$pkgname::git+https://github.com/AlessandroZ/LaZagne.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md CHANGELOG
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cp -a --no-preserve=ownership Linux/* "$pkgdir/usr/share/$pkgname/"

cat >> "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python laZagne.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

